var req3;

function deleteMails()
{
    if (confirm("Are you sure you want to delete"))
    {
        var mailIDs = "";
        for (i=0; i<document.mailList.chkid.length; i++)
        {
            if (document.mailList.chkid[i].checked == true)
            {
                mailIDs += document.mailList.chkid[i].value + ",";
            }
        }

        var url = "/SRS-war/DeleteMailServlet?mailIDs=" + mailIDs;

        if (window.XMLHttpRequest)
        {
            req3 = new XMLHttpRequest();
        }
        else if (window.ActiveXObject)
        {
            req3 = new ActiveXObject("Microsoft.XMLHTTP");
        }

        req3.open("Get",url,true);
        req3.onreadystatechange = callback3;
        req3.send(null);
    }
}

function callback3()
{
    if (req3.readyState==4)
    {
        if (req3.status == 200)
        {
            getMailList(globalPage);
            countPage();
            alert(req3.responseText + " mail deleted!");
        }
    }
}






